﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace VisionCloud.Core.Model.Ms
{
    [Table("MsRobotLog")]
    public partial class MsRobotLog
    {
        /// <summary>
        /// 日志等级枚举
        /// </summary>
        public enum LogLevelEnum
        {
            FATAL = 1,   // A fatal error. The application will most likely terminate. This is the highest priority.
            CRITICAL,    // A critical error. The application might not be able to continue running successfully.
            ERROR,       // An error. An operation did not complete successfully, but the application as a whole is not affected.
            WARNING,     // A warning. An operation completed with an unexpected result.
            NOTICE,      // A notice, which is an information with just a higher priority.
            INFORMATION, // An informational message, usually denoting the successful completion of an operation.
            DEBUG,       // A debugging message.
            TRACE        // A tracing message. This is the lowest priority.
        }

        /// <summary>
        /// 事件Id
        /// </summary>
        [Key]
        [Column(TypeName = "uuid")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid RobotLogId { get; set; }

        /// <summary>
        /// 设备Id
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string RobotId { get; set; }

        /// <summary>
        /// 系统
        /// </summary>
        [Column(TypeName = "varchar(32)")]
        public string SubSystem { get; set; }

        /// <summary>
        /// 事件等级
        /// </summary>
        [Column(TypeName = "int4")]
        public LogLevelEnum LogLevel { get; set; }

        /// <summary>
        /// 事件内容
        /// </summary>
        [Column(TypeName = "varchar(1024)")]
        public string Message { get; set; }

        /// <summary>
        /// 事件发生时间
        /// </summary>
        [Column(TypeName = "timestamp")]
        public DateTime? Time { get; set; }

        [ForeignKey("RobotId")]
        public virtual MsRobot MsRobot { get; set; }
    }
}